<template>
  <div class="content">
    <div class="index-header-box" id="head">
      <div class="index-header">
        <div @click="$router.back(-1)" class="back">
          <van-icon name="arrow-left"/>
        </div>
        <router-link :to="{name:'UserInfoUpdate'}" class="header-right">完善信息</router-link>

        <div class="title">用户信息</div>
      </div>
    </div>
    <van-index-anchor index="基础信息" style="background: #F4F4F4" />
    <van-cell title="用户昵称" :value="UserData.nickname" />
    <van-cell title="手机号码" :value="UserData.mobile" />
    <van-cell title="性别" :value="columnsSex[UserData.sex]" />
    <van-cell title="生日" :value="formatDate(UserData.birthday)" />

    <van-index-anchor index="收款信息" style="background: #F4F4F4" />
    <van-cell title="支付宝收款账号" :value="UserData.alipay_user" />
    <van-cell title="微信收款账号" :value="UserData.wechat_user" />

    <div class="btn-box">
      <van-button type="info" class="btn-primary" @click="loginOut">退出登录</van-button>
    </div>
  </div>
</template>

<script>
import storeJs from 'storejs'

export default {
    name: "invite_more",
    components: {},
    data() {
      return {
        columnsSex: ['保密', '男', '女'],
        UserData:{}
      }
    },
    computed: {},
    mounted: function () {
      this.UserData = this.isLogin();

    },
    methods: {
        loginOut(){
            storeJs.remove("carToken");
            storeJs.remove("User");
            this.$router.replace({
                path: '/login',
                query: {
                    redirect: this.$router.currentRoute.fullPath
                }
            });
        }
    },
}
</script>

<style lang="scss" scoped>
  @import "../../assets/scss/user.scss";
</style>
